<div class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow:auto;padding:5px;background:#fff;border:1px solid #ccc;height:<?=$tinggiregion?>px;"> 
		<?php if($type == "pesanan_konsumen"){?>
			<form  method="post" id="<?=$type?>_form" url="<?=base_url()?>supply/savedata/<?=$type?>" enctype="multipart/form-data">
				<input type='hidden' name='editstatus' value="<?=$editstatus?>" >
				<input type='hidden' name='id' value="<?=($editstatus == 'edit' ? $datarecord->id : '')?>" >
			<fieldset>
			<legend>Data Pesanan</legend>								
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;width:500px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">No. Surat Pesanan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="no_surat_pesanan" value='<?=($editstatus == 'edit' ? $datarecord->no_surat_pesanan : $no_surat_pesanan)?>' readonly name='no_surat_pesanan' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Pesanan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='' id='tanggal_pesanan' name='tanggal_pesanan' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Dealer</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_dealer : '')?>' id='dealer_<?=$type?>' readonly style="width:258px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_dealer_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_dealer : '')?>' id='id_dealer_<?=$type?>' name='id_dealer'>								
							</td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;margin-left:40px;width:450px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Nama Customer</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="nama_customer" value='<?=($editstatus == 'edit' ? $datarecord->nama_customer : '')?>' name='nama_customer' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">No. Handphone</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="no_handphone" value='<?=($editstatus == 'edit' ? $datarecord->no_handphone : '')?>' name='no_handphone' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Alamat KTP</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<textarea name="alamat_ktp_customer" style="width:300px; border: 1px solid silver; padding: 1px;" rows='2'><?=($editstatus == 'edit' ? $datarecord->alamat_ktp_customer : '')?></textarea>								
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Alamat Sebenarnya</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<textarea name="alamat_tinggal_customer" style="width:300px; border: 1px solid silver; padding: 1px;" rows='2'><?=($editstatus == 'edit' ? $datarecord->alamat_tinggal_customer : '')?></textarea>								
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Uang Muka</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="uang_muka" value='<?=($editstatus == 'edit' ? $datarecord->uang_muka : '')?>' name='uang_muka' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
					</table>					
				</fieldset>
				<fieldset>
				<legend>Data Barang</legend>
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;width:500px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Barang</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_barang : '')?>' id='barang_<?=$type?>' readonly style="width:258px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_barang_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_generator : '')?>' id='id_barang_<?=$type?>' name='id_generator'>																
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Quantity</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="quantity_pesanan" value='<?=($editstatus == 'edit' ? $datarecord->quantity_pesanan : '')?>' name='quantity_pesanan' style="width:50px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;margin-left:40px;width:450px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Jenis Penjualan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<select id='jenis_penjualan' name='jenis_penjualan' style="width:303px; border: 1px solid silver; padding: 1px;">
									<?=$combo_jenis_penjualan?>
								</select>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Pembiayaan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="pembiayaan" value='<?=($editstatus == 'edit' ? $datarecord->pembiayaan : '')?>' name='pembiayaan' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>						
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Nama Surveyor</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="nama_surveyor" value='<?=($editstatus == 'edit' ? $datarecord->nama_surveyor : '')?>' name='nama_surveyor' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						
					</table>
				</fieldset>
			</form>
		<?php }elseif($type == "mutasi_generator" || $type == "mutasi_promosi"){?>
			<form  method="post" id="<?=$type?>_form" url="<?=base_url()?>supply/savedata/<?=$type?>" enctype="multipart/form-data">
				<input type='hidden' name='editstatus' value="<?=$editstatus?>" >
				<input type='hidden' name='id' value="<?=($editstatus == 'edit' ? $datarecord->id : '')?>" >
			<fieldset>
			<legend>Mutasi Barang</legend>							
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;width:450px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">No. Mutasi</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="no_mutasi_barang" value='<?=($editstatus == 'edit' ? $datarecord->no_mutasi_barang : $no_mutasi_barang)?>' readonly name='no_mutasi_barang' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Mutasi</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='' id='tgl_mutasi' name='tgl_mutasi' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Dealer</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_dealer : '')?>' id='dealer_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_dealer_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_dealer : '')?>' id='id_dealer_<?=$type?>' name='id_dealer'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Gudang</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_gudang : '')?>' id='gudang_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_gudang_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_gudang : '')?>' id='id_gudang_<?=$type?>' name='id_gudang'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Dealer Tujuan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->dealer_tujuan : '')?>' id='dealer_transfer_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_dealer_transfer_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_dealer_transfer : '')?>' id='id_dealer_transfer_<?=$type?>' name='id_dealer_transfer'>
							</td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;margin-left:40px;width:500px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Petugas Pengecek</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_pengecek : '')?>' id='pengecek_<?=$type?>' readonly style="width:258px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_pengecek_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_pengecek : '')?>' id='id_pengecek_<?=$type?>' name='id_pengecek'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Petugas Pengirim</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_pengirim : '')?>' id='pengirim_<?=$type?>' readonly style="width:258px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_pengirim_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_pengirim : '')?>' id='id_pengirim_<?=$type?>' name='id_pengirim'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Type Kendaraan & No. Polisi</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->type_kendaraan : '')?>' id='type_kendaraan' name='type_kendaraan' style="width:140px; border: 1px solid silver; padding: 1px;">
								&nbsp;
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->no_polisi : '')?>' id='no_polisi' name='no_polisi' style="width:140px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>						
					</table>					
				</fieldset>
				<fieldset>
					<legend>Data Barang</legend>
						<br />
						Barang &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Quantitiy &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Satuan &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Total Nominal &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<br />						
						<?php if($editstatus== 'add' || $detailmutasi == 0){?>
						<input type='text' id='dtbarang_<?=$type?>_0' style="width:200px; border: 1px solid silver; padding: 1px;">
							<a id="get_dtbarang_<?=$type?>_0" onClick="getdatabawah(0);" class="l-btn l-btn-plain" href="#">
								<span class="l-btn-left">
									<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
								</span>
							</a>
							<input type='hidden' id='id_barang_<?=$type?>_0' name='id_barang[]'>&nbsp;
							<input type='hidden' value='addnya' id='' name='parameter[]'>
							<input type='hidden' value='' id='' name='id_detail[]'>
							
						<input type='text' id='quantity_<?=$type?>_0' name='quantity[]' style="width:50px; border: 1px solid silver; padding: 1px;">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type='text' id='satuan_<?=$type?>_0' name='satuan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type='text' id='total_nominal_<?=$type?>_0' name='total_nominal[]' style="width:50px; border: 1px solid silver; padding: 1px;">
						<?php }elseif($editstatus == 'edit' || $detailmutasi != 0){?>
							<?php foreach($detailmutasi as $k => $v){?>
								<input type='text' value='<?=($v['nama_barang'] == '' ? '' : $v['nama_barang'])?>' readonly id='dtbarang_<?=$type?>_0' style="width:200px; border: 1px solid silver; padding: 1px;">
									<a id="get_dtbarang_<?=$type?>_0" onClick="getdatabawah(0);" class="l-btn l-btn-plain" href="#">
										<span class="l-btn-left">
											<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
										</span>
									</a>
									<input type='hidden' value='<?=($v['id_barang'] == '' ? '' : $v['id_barang'])?>' id='id_barang_<?=$type?>_0' name='id_barang[]'>&nbsp;
									<input type='hidden' value='editnya' id='' name='parameter[]'>
									<input type='hidden' value='<?=($v['id'] == '' ? '' : $v['id'])?>' id='' name='id_detail[]'>
									
								<input type='text' value='<?=($v['quantity'] == '' ? '' : $v['quantity'])?>' id='quantity_<?=$type?>_0' name='quantity[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['satuan'] == '' ? '' : $v['satuan'])?>' id='satuan_<?=$type?>_0' name='satuan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['total_nominal'] == '' ? '' : $v['total_nominal'])?>' id='total_nominal_<?=$type?>_0' name='total_nominal[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								<br />
							<?php }?>
						<?php }?>
						<br />
						<div id='<?=$type?>_add0'></div>
						<br />
						<a id="addfield_<?=$type?>" class="l-btn l-btn-plain" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text icon-add" style="padding-left: 20px;">Tambah</span>
							</span>
						</a>			
						<a id="delfield_<?=$type?>" class="l-btn l-btn-plain" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text icon-remove" style="padding-left: 20px;">Hapus Field</span>
							</span>
						</a>						
				</fieldset>
				</form>
		<?php }elseif($type == "penerimaan_generator" || $type == "penerimaan_promosi"){?>
			<form  method="post" id="<?=$type?>_form" url="<?=base_url()?>supply/savedata/<?=$type?>" enctype="multipart/form-data">
				<input type='hidden' name='editstatus' value="<?=$editstatus?>" >
				<input type='hidden' name='id' value="<?=($editstatus == 'edit' ? $datarecord->id : '')?>" >
			<fieldset>
			<legend>Penerimaan Barang</legend>							
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;width:450px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">No. Penerimaan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id="no_penerimaan_barang" value='<?=($editstatus == 'edit' ? $datarecord->no_penerimaan_barang : $no_penerimaan_barang)?>' readonly name='no_penerimaan_barang' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Terima Barang</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' id='tgl_terima_barang' name='tgl_terima_barang' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Dealer</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_dealer : '')?>' id='dealer_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_dealer_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_dealer : '')?>' id='id_dealer_<?=$type?>' name='id_dealer'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">No. Mutasi</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->no_mutasi_barang : '')?>' id='mutasi_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_mutasi_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_mutasi : '')?>' id='id_mutasi_<?=$type?>' name='id_mutasi'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Mutasi Barang</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<span id='tgl_mutasi_brg_<?=$type?>'><?=($editstatus == 'edit' ? $datarecord->tgl_mutasi : '')?></span>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Nama Pengirim</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<span id='pngrim_brg_<?=$type?>'><?=($editstatus == 'edit' ? $datarecord->nama_pengirim : '')?></span>
							</td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="2" style="float:left;padding-top:0px;margin-left:40px;width:490px;">
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Petugas Penerima</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_penerima : '')?>' id='penerima_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_penerima_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_penerima : '')?>' id='id_penerima_<?=$type?>' name='id_penerima'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Petugas Pengecek</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='<?=($editstatus == 'edit' ? $datarecord->nama_pengecek : '')?>' id='pengecek_<?=$type?>' readonly style="width:250px; border: 1px solid silver; padding: 1px;"> &nbsp;
								<a id="get_pengecek_<?=$type?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>
								<input type='hidden' value='<?=($editstatus == 'edit' ? $datarecord->id_pengecek : '')?>' id='id_pengecek_<?=$type?>' name='id_pengecek'>
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Pengiriman</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='' id='tgl_pengiriman' name='tgl_pengiriman' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
						<tr>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:35%;">Tanggal Penerimaan</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:10px">:</td>
							<td style="vertical-align: top; font-family: inherit; padding-bottom: 5px; width:100px">
								<input type='text' value='' id='tgl_penerimaan' name='tgl_penerimaan' style="width:300px; border: 1px solid silver; padding: 1px;">
							</td>
						</tr>
					</table>
			</fieldset>
				<fieldset>
					<legend>Data Barang</legend>
						<br />
						Barang &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Quantitiy &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Satuan &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Total Nominal &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Qty Terima &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Qty Selisih &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Keterangan <br />
						<?php if($editstatus== 'add' || $detailpenerimaan == 0){?>
							<input type="text" id='dtbarang_<?=$type?>_0' style="width:200px; border: 1px solid silver; padding: 1px;">
								<a id="get_dtbarang_<?=$type?>_0" onClick="getdatabawah(0);" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
									</span>
								</a>							
								<input type='hidden' id='id_barang_<?=$type?>_0' name='id_barang[]'>&nbsp;
								<input type='hidden' value='addnya' id='' name='parameter[]'>
								<input type='hidden' value='' id='' name='id_detail[]'>
								
							<input type='text' name='quantity[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type='text' name='satuan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type='text' name='total_nominal[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type='text' name='qty_terima[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type='text' name='selisih[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<input type='text' name='keterangan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
						<?php }elseif($editstatus == 'edit' || $detailpenerimaan != 0){?>
							<?php foreach($detailpenerimaan as $k => $v){?>
								<input type='text' value='<?=($v['nama_barang'] == '' ? '' : $v['nama_barang'])?>' readonly id='dtbarang_<?=$type?>_0' style="width:200px; border: 1px solid silver; padding: 1px;">
									<a id="get_dtbarang_<?=$type?>_0" onClick="getdatabawah(0);" class="l-btn l-btn-plain" href="#">
										<span class="l-btn-left">
											<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
										</span>
									</a>
									<input type='hidden' value='<?=($v['id_barang'] == '' ? '' : $v['id_barang'])?>' id='id_barang_<?=$type?>_0' name='id_barang[]'>&nbsp;
									<input type='hidden' value='editnya' id='' name='parameter[]'>
									<input type='hidden' value='<?=($v['id'] == '' ? '' : $v['id'])?>' id='' name='id_detail[]'>
									
								<input type='text' value='<?=($v['quantity'] == '' ? '' : $v['quantity'])?>' id='quantity_<?=$type?>_0' name='quantity[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['satuan'] == '' ? '' : $v['satuan'])?>' id='satuan_<?=$type?>_0' name='satuan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['total_nominal'] == '' ? '' : $v['total_nominal'])?>' id='total_nominal_<?=$type?>_0' name='total_nominal[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['qty_terima'] == '' ? '' : $v['qty_terima'])?>' name='qty_terima[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['selisih'] == '' ? '' : $v['selisih'])?>' name='selisih[]' style="width:50px; border: 1px solid silver; padding: 1px;">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input type='text' value='<?=($v['keterangan'] == '' ? '' : $v['keterangan'])?>' name='keterangan[]' style="width:50px; border: 1px solid silver; padding: 1px;">
								<br />
							<?php } ?>	
						<?php } ?>	
						<br />
						<div id='<?=$type?>_add0'></div>
						<br />
						<a id="addfield_<?=$type?>" class="l-btn l-btn-plain" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text icon-add" style="padding-left: 20px;">Tambah</span>
							</span>
						</a>			
						<a id="delfield_<?=$type?>" class="l-btn l-btn-plain" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text icon-remove" style="padding-left: 20px;">Hapus Field</span>
							</span>
						</a>						
				</fieldset>			
			</form>
		<?php }?>
	</div>
	
	<div region="south" border="false" style="text-align:right;padding:5px 0;">
		<a id="btnSend_<?=$type?>" class="l-btn l-btn-plain" iconcls="disk" href="#">
            <span class="l-btn-left">
                <span class="l-btn-text disk" style="padding-left: 20px;">Simpan</span>
            </span>
        </a>
		<a id="btnBatal_<?=$type?>" class="l-btn l-btn-plain" onclick="kembali_supply('<?=$type?>')" iconcls="cancel" href="#">
            <span class="l-btn-left">
                <span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
            </span>
        </a>
	</div>
</div>

<script>
	var type_supply_form = "<?=$type?>";
	var editstatus_supply = "<?=$editstatus?>";	
	
	<?php if($type == 'pesanan_konsumen'){?>
		var tanggal_pesanan = "<?=($editstatus == 'edit' ? $datarecord->tanggal_pesanan : '')?>";
	<?php } ?>
	<?php if($type == 'mutasi_generator' || $type == 'mutasi_promosi'){?>
		var tanggal_mutasi = "<?=($editstatus == 'edit' ? $datarecord->tgl_mutasi : '')?>";
	<?php } ?>
	<?php if($type == 'penerimaan_generator' || $type == 'penerimaan_promosi'){?>
		var tgl_terima_barang = "<?=($editstatus == 'edit' ? $datarecord->tgl_terima_barang : '')?>";
		var tgl_pengiriman = "<?=($editstatus == 'edit' ? $datarecord->tgl_pengiriman : '')?>";
		var tgl_penerimaan = "<?=($editstatus == 'edit' ? $datarecord->tgl_penerimaan : '')?>";
	<?php } ?>		

</script>
<script type="text/javascript" src="<?=base_url()?>assets/js/supply/supply_form.js"></script>
